//
//  SuggestViewController.m
//  LOU
//
//  Created by iMacOne on 15/11/7.
//  Copyright © 2015年 UNOHACHA. All rights reserved.
//

#import "SuggestViewController.h"
#import "ToolUtil.h"
#import "Size.h"
@interface SuggestViewController ()
@property (nonatomic, strong)UITextView * textView;
@property (nonatomic, strong)UILabel * placeholderLabel;
@property (nonatomic, strong)UIButton * enterButton;

@end

@implementation SuggestViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.tabBarController.tabBar.hidden = YES;
    [ToolUtil createLine:margin_64 superView:self.view lift:0 width:WindowWidth hight:0.5 color:[UIColor grayColor]];

    [self createTitle:@"设置" midTitle:@"意见反馈"];
    [self creatView];
    // Do any additional setup after loading the view.
}
- (void)creatView
{
    self.textView = [[UITextView alloc] initWithFrame:CGRectMake(margin_10, margin_90, WindowWidth - 2 * margin_10, margin_140)];
    _textView.delegate = self;
    _textView.backgroundColor = [UIColor grayColor];
    self.placeholderLabel = [[UILabel alloc] initWithFrame:CGRectMake(3, 7, margin_100, margin_15)];
    _placeholderLabel.text = @"请输入建议";
    _placeholderLabel.font = FONT(14);
    _placeholderLabel.textColor = [UIColor grayColor];
    _placeholderLabel.enabled = NO;
    [_textView addSubview:_placeholderLabel];
    [self.view addSubview:_textView];
    
    self.enterButton = [UIButton buttonWithType:UIButtonTypeCustom];
    _enterButton.frame = CGRectMake((WindowWidth - margin_250) / 2, CGRectGetMaxY(_textView.frame) + margin_20, margin_250, margin_34);
    _enterButton.backgroundColor = DEBUG_CLOLR;
    _enterButton.layer.masksToBounds = YES;
    _enterButton.layer.cornerRadius = margin_5;
    _enterButton.backgroundColor = [UIColor blackColor];
    _enterButton.titleLabel.font = FONT(14);
    _enterButton.tag = 200;
    [_enterButton setTitle:@"提交反馈" forState:UIControlStateNormal];
    [_enterButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];

    [_enterButton addTarget:self action:@selector(doClickButton:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:_enterButton];
    
    
}
- (void)doClickButton:(UIButton *)btn
{
    NSLog(@"提交反馈");
}
- (void)textViewDidChange:(UITextView *)textView;

{
    if ([ToolUtil isBlank:textView.text]) {
        self.placeholderLabel.hidden = NO;
    }else {
        self.placeholderLabel.hidden = YES;
    }
    
}
- (void)doBack:(UIButton*)btnBack{
    [self.navigationController popViewControllerAnimated:YES];
    self.tabBarController.tabBar.hidden = YES;
    
}


@end
